home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Applications / Nuntius 1.2 / src / Nuntius / UDPPB.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-20  |  2.3 KB  |  109 lines  |  [TEXT/MPS ]

  1. /* 
  2.     UDPPB.h    
  3.     C definitions of parameter block entries needed for UDP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-91 
  6.     All rights reserved
  7.     Modifications by Steve Falkenburg, Apple MacDTS 8/91
  8.         
  9. */
  10.  
  11. /* conditional #include -->SJF<-- */
  12.  
  13. #ifndef __UDPPB__
  14. #define __UDPPB__
  15.  
  16. /* added for misc. definitions  -->SJF<-- */
  17. #ifndef __MACTCPCOMMONTYPES__
  18. #include <MacTCPCommonTypes.h>
  19. #endif
  20.  
  21. #define UDPCreate        20
  22. #define UDPRead            21
  23. #define UDPBfrReturn    22
  24. #define UDPWrite        23
  25. #define UDPRelease        24
  26. #define UDPMaxMTUSize    25
  27. #define UDPStatus        26
  28. #define UDPMultiCreate    27
  29. #define UDPMultiSend    28
  30. #define UDPMultiRead    29
  31. #define UDPCtlMax        29
  32.  
  33. typedef enum UDPEventCode {
  34.     UDPDataArrival = 1,
  35.     UDPICMPReceived,
  36.     lastUDPEvent = 32767
  37.     } UDPEventCode;
  38.  
  39. #ifdef THINK_C
  40. typedef ProcPtr UDPNotifyProc;
  41. #else
  42. typedef pascal void (*UDPNotifyProc) (
  43.         StreamPtr udpStream, 
  44.         unsigned short eventCode, 
  45.         Ptr userDataPtr,
  46.         struct ICMPReport *icmpMsg);
  47. #endif
  48.  
  49. typedef void (*UDPIOCompletionProc) (struct UDPiopb *iopb);
  50.  
  51. typedef    unsigned short    udp_port;
  52.  
  53. typedef struct UDPCreatePB {            /* for create and release calls */
  54.     Ptr             rcvBuff;
  55.     unsigned long    rcvBuffLen;
  56.     UDPNotifyProc    notifyProc;
  57.     unsigned short    localPort;
  58.     Ptr                userDataPtr;
  59.     udp_port        endingPort;
  60. } UDPCreatePB;
  61.     
  62. typedef struct UDPSendPB {
  63.     unsigned short    reserved;
  64.     ip_addr            remoteHost;
  65.     udp_port        remotePort;
  66.     Ptr                wdsPtr;
  67.     Boolean            checkSum;    
  68.     unsigned short    sendLength;
  69.     Ptr                userDataPtr;
  70.     udp_port        localPort;
  71. } UDPSendPB;
  72.     
  73. typedef struct UDPReceivePB {        /* for receive and buffer return calls */
  74.     unsigned short    timeOut;
  75.     ip_addr            remoteHost;
  76.     udp_port        remotePort;
  77.     Ptr             rcvBuff;
  78.     unsigned short    rcvBuffLen;
  79.     unsigned short    secondTimeStamp;
  80.     Ptr                 userDataPtr;
  81.     ip_addr            destHost;        /* only for use with multi rcv */
  82.     udp_port        destPort;        /* only for use with multi rcv */
  83. } UDPReceivePB;
  84.  
  85. typedef struct UDPMTUPB {
  86.     unsigned short     mtuSize;
  87.     ip_addr            remoteHost;
  88.     Ptr                userDataPtr;
  89. } UDPMTUPB;
  90.  
  91. typedef struct UDPiopb {
  92.     char                 fill12[12];
  93.     UDPIOCompletionProc    ioCompletion;
  94.     short                 ioResult;
  95.     char                 *ioNamePtr;        
  96.     short                 ioVRefNum;        
  97.     short                ioCRefNum;            
  98.     short                 csCode;
  99.     StreamPtr             udpStream;                
  100.     union {
  101.         struct UDPCreatePB    create;
  102.         struct UDPSendPB    send;
  103.         struct UDPReceivePB    receive;
  104.         struct UDPMTUPB        mtu;
  105.     } csParam;
  106. } UDPiopb;
  107.     
  108. #endif      /* conditional include -->SJF<-- */
  109.